package com.cskaoyan.controller.backStage;

import com.cskaoyan.model.vo.BaseRespVO;
import com.cskaoyan.model.vo.ExceptionVO;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.Serializable;
// 不授权
/**
 * @program: mall38
 * @description: 用户profile
 * @author: Lexis
 * @create: 2022-05-10 10:05
 **/
@RestController
@RequestMapping("admin/profile")
public class ProfileController {

    @GetMapping("nnotice")
    /**
     * @author: lixiaosheng
     * @description: 获取当前用户的登录状态
     * @date: 2022/5/10 10:11
     */
    public ExceptionVO nnotice(){
        Subject subject = SecurityUtils.getSubject();
        if(!subject.isAuthenticated()){
            return ExceptionVO.error("未登录");
        }
        return BaseRespVO.ok(0);
    }
}
